# coding:utf-8
def add_num(num1,num2):
    try:
        sum = num2+num1
    except ValueError:
        print("请输入正确的数字类型数据")
    else:
        return sum

while True:
    num1 = input("请输入第一个数")
    if num1 == 'q':
        break
    num2 = input("请输入第二个数")
    if num2 == '1':
        break
    try:
        print(f"{num1}+{num2}={add_num(int(num1),int(num2))}")
    except ValueError:
        print("请输入正确的数字类型数据")